home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17168 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: prairienet.org!wemccaug
  2. From: wemccaug@prairienet.org (Wendy E. McCaughrin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: HELP on abstraction!!!
  5. Date: 14 Apr 1996 00:56:30 GMT
  6. Organization: University of Illinois at Urbana
  7. Message-ID: <4kpifu$63j@vixen.cso.uiuc.edu>
  8. References: <316704f9.4805163@news> <4jok9c$a6e@merkurius.lu.se>
  9. Reply-To: wemccaug@prairienet.org (Wendy E. McCaughrin)
  10. NNTP-Posting-Host: firefly.prairienet.org
  11.  
  12.  
  13. In a previous article, Amir@bayarea.net (Amir) says:
  14.  
  15. >On 1 Apr 1996 13:04:44 GMT, magnus_dahlberg@hermes.ics.lu.se (Magnus
  16. >Dahlberg) wrote:
  17. >
  18. >>Hello everyone!
  19. >>
  20. >>I'm writing a C++ programme that should be able to use both arrays and
  21. >>linked lists without changing the functions. Is it possible, for
  22. >>example, to insert a new person in my list (queue) without knowing if
  23. >>it's an array or a linked list? And if it is, how do I do it? 
  24. >>
  25.  This appears like a job for overloading of functions, so that, for 
  26.  example, one 'insert' for linked lists and another 'insert' for arrays.
  27.  If the definitions of two functions were sufficiently similar in some
  28.  cases, I would then suggest using templates (e.g., to count number of
  29.  elements).
  30.